package org.dna.opdracht1;
import static org.dna.opdracht1.Apl.NANO;

public abstract class RandomPerm {

	private long startTime, endTime, totalTime;
	private String name;

	protected abstract int[] randomPerm(int n);
	
	public RandomPerm(String name){
		this.name = name;
	}

	private void start() {
		startTime = System.nanoTime();
	}

	private void stop() {
		endTime = System.nanoTime();
		totalTime = endTime - startTime;
	}
	
	public int[] randomInt(int n) {
		start();
		int[] array = randomPerm(n);
		stop();
		return array;
	}

	public long getTotalRunningTime() {
		return totalTime/NANO;
	}

	public long getStartTime() {
		return startTime;
	}

	public long getEndTime() {
		return endTime;
	}
	
	public String getName(){
		return name;
	}

}
